Security Audit & Remediation: quickstart-testing monorepo#464
Conversation
…errides, and consolidate workspaces under root lockfile
There was a problem hiding this comment.
Code Review
This pull request updates the Node.js engine requirement to >=22.0.0 and upgrades several dependencies, including firebase-tools and lerna, across multiple package.json files. It also introduces dependency overrides to resolve specific package versions. The feedback highlights that in npm workspaces, the overrides block is only respected in the root package.json and is ignored in individual workspace packages. To avoid redundancy and maintenance overhead, these ignored overrides blocks should be removed from the sub-packages.
| "overrides": { | ||
| "serialize-javascript": "^7.0.6", | ||
| "tar": "^7.5.16", | ||
| "qs": "^6.15.2", | ||
| "uuid": "^11.1.1", | ||
| "tough-cookie": "^4.1.3", | ||
| "yaml": "^2.9.0", | ||
| "http-proxy-agent": "^7.0.2", | ||
| "https-proxy-agent": "^7.0.6", | ||
| "ip": "^2.0.1", | ||
| "ms": "^2.1.3", | ||
| "netmask": "^2.1.1", | ||
| "js-yaml": "^4.1.0", | ||
| "merge": "^2.1.1", | ||
| "degenerator": "^5.0.1", | ||
| "extend": "^3.0.2", | ||
| "form-data": "^4.0.6", | ||
| "debug": "^4.4.0", | ||
| "pac-resolver": "^5.0.0", | ||
| "protobufjs": "^7.6.4", | ||
| "node-forge": "^1.4.0", | ||
| "path-to-regexp": "^0.1.13", | ||
| "@grpc/grpc-js": "^1.14.4", | ||
| "jsonwebtoken": "^9.0.3", | ||
| "dicer": "^0.3.1", | ||
| "fast-xml-parser": "^5.9.3" | ||
| }, |
There was a problem hiding this comment.
In npm workspaces, the overrides block is only respected when defined in the root package.json. Overrides defined in individual workspace package.json files are ignored by npm. To avoid redundancy and maintenance overhead, you should remove this block from the workspace configuration and rely solely on the root package.json overrides.
| }, | ||
| "overrides": { | ||
| "serialize-javascript": "^7.0.6", | ||
| "tar": "^7.5.16", | ||
| "qs": "^6.15.2", | ||
| "uuid": "^11.1.1", | ||
| "tough-cookie": "^4.1.3", | ||
| "yaml": "^2.9.0", | ||
| "http-proxy-agent": "^7.0.2", | ||
| "https-proxy-agent": "^7.0.6", | ||
| "ip": "^2.0.1", | ||
| "ms": "^2.1.3", | ||
| "netmask": "^2.1.1", | ||
| "js-yaml": "^4.1.0", | ||
| "merge": "^2.1.1", | ||
| "degenerator": "^5.0.1", | ||
| "extend": "^3.0.2", | ||
| "form-data": "^4.0.6", | ||
| "debug": "^4.4.0", | ||
| "pac-resolver": "^5.0.0", | ||
| "protobufjs": "^7.6.4", | ||
| "node-forge": "^1.4.0", | ||
| "path-to-regexp": "^0.1.13", | ||
| "@grpc/grpc-js": "^1.14.4", | ||
| "jsonwebtoken": "^9.0.3", | ||
| "dicer": "^0.3.1", | ||
| "fast-xml-parser": "^5.9.3" | ||
| } |
There was a problem hiding this comment.
In npm workspaces, the overrides block is only respected when defined in the root package.json. Overrides defined in individual workspace package.json files are ignored by npm. To avoid redundancy and maintenance overhead, you should remove this block from the workspace configuration and rely solely on the root package.json overrides.
}| "overrides": { | ||
| "serialize-javascript": "^7.0.6", | ||
| "tar": "^7.5.16", | ||
| "qs": "^6.15.2", | ||
| "uuid": "^11.1.1", | ||
| "tough-cookie": "^4.1.3", | ||
| "yaml": "^2.9.0", | ||
| "http-proxy-agent": "^7.0.2", | ||
| "https-proxy-agent": "^7.0.6", | ||
| "ip": "^2.0.1", | ||
| "ms": "^2.1.3", | ||
| "netmask": "^2.1.1", | ||
| "js-yaml": "^4.1.0", | ||
| "merge": "^2.1.1", | ||
| "degenerator": "^5.0.1", | ||
| "extend": "^3.0.2", | ||
| "form-data": "^4.0.6", | ||
| "debug": "^4.4.0", | ||
| "pac-resolver": "^5.0.0", | ||
| "protobufjs": "^7.6.4", | ||
| "node-forge": "^1.4.0", | ||
| "path-to-regexp": "^0.1.13", | ||
| "@grpc/grpc-js": "^1.14.4", | ||
| "jsonwebtoken": "^9.0.3", | ||
| "dicer": "^0.3.1", | ||
| "fast-xml-parser": "^5.9.3" | ||
| }, |
There was a problem hiding this comment.
In npm workspaces, the overrides block is only respected when defined in the root package.json. Overrides defined in individual workspace package.json files are ignored by npm. To avoid redundancy and maintenance overhead, you should remove this block from the workspace configuration and rely solely on the root package.json overrides.
| }, | ||
| "overrides": { | ||
| "serialize-javascript": "^7.0.6", | ||
| "tar": "^7.5.16", | ||
| "qs": "^6.15.2", | ||
| "uuid": "^11.1.1", | ||
| "tough-cookie": "^4.1.3", | ||
| "yaml": "^2.9.0", | ||
| "http-proxy-agent": "^7.0.2", | ||
| "https-proxy-agent": "^7.0.6", | ||
| "ip": "^2.0.1", | ||
| "ms": "^2.1.3", | ||
| "netmask": "^2.1.1", | ||
| "js-yaml": "^4.1.0", | ||
| "merge": "^2.1.1", | ||
| "degenerator": "^5.0.1", | ||
| "extend": "^3.0.2", | ||
| "form-data": "^4.0.6", | ||
| "debug": "^4.4.0", | ||
| "pac-resolver": "^5.0.0", | ||
| "protobufjs": "^7.6.4", | ||
| "node-forge": "^1.4.0", | ||
| "path-to-regexp": "^0.1.13", | ||
| "@grpc/grpc-js": "^1.14.4", | ||
| "jsonwebtoken": "^9.0.3", | ||
| "dicer": "^0.3.1", | ||
| "fast-xml-parser": "^5.9.3" | ||
| } |
There was a problem hiding this comment.
In npm workspaces, the overrides block is only respected when defined in the root package.json. Overrides defined in individual workspace package.json files are ignored by npm. To avoid redundancy and maintenance overhead, you should remove this block from the workspace configuration and rely solely on the root package.json overrides.
}| }, | ||
| "overrides": { | ||
| "serialize-javascript": "^7.0.6", | ||
| "tar": "^7.5.16", | ||
| "qs": "^6.15.2", | ||
| "uuid": "^11.1.1", | ||
| "tough-cookie": "^4.1.3", | ||
| "yaml": "^2.9.0", | ||
| "http-proxy-agent": "^7.0.2", | ||
| "https-proxy-agent": "^7.0.6", | ||
| "ip": "^2.0.1", | ||
| "ms": "^2.1.3", | ||
| "netmask": "^2.1.1", | ||
| "js-yaml": "^4.1.0", | ||
| "merge": "^2.1.1", | ||
| "degenerator": "^5.0.1", | ||
| "extend": "^3.0.2", | ||
| "form-data": "^4.0.6", | ||
| "debug": "^4.4.0", | ||
| "pac-resolver": "^5.0.0", | ||
| "protobufjs": "^7.6.4", | ||
| "node-forge": "^1.4.0", | ||
| "path-to-regexp": "^0.1.13", | ||
| "@grpc/grpc-js": "^1.14.4", | ||
| "jsonwebtoken": "^9.0.3", | ||
| "dicer": "^0.3.1", | ||
| "fast-xml-parser": "^5.9.3" | ||
| } |
There was a problem hiding this comment.
In npm workspaces, the overrides block is only respected when defined in the root package.json. Overrides defined in individual workspace package.json files are ignored by npm. To avoid redundancy and maintenance overhead, you should remove this block from the workspace configuration and rely solely on the root package.json overrides.
}
Security Audit & Remediation: quickstart-testing monorepo
A. Previous CVEs
vm2, command injection inopen, prototype pollution inprotobufjs,merge, andtough-cookie, SSRF inip, and arbitrary file read/write intar.B. Changes Made
node: ">=22.0.0"in all workspaces (and root).firebase-toolsfrom^12.4.0to^15.22.1andlernafrom^7.1.0to^9.0.7.firebase-toolsdependency in workspaces from9.19.0/12.4.0to^15.22.1.package-lock.jsonandnode-modulesfiles from individual workspaces to consolidate workspaces under a single rootpackage-lock.json, resolving invalid dependency resolution.file-systemdependency fromcs-walkthrough/functions.serialize-javascript->^7.0.6tar->^7.5.16qs->^6.15.2uuid->^11.1.1tough-cookie->^4.1.3yaml->^2.9.0http-proxy-agent->^7.0.2https-proxy-agent->^7.0.6ip->^2.0.1ms->^2.1.3netmask->^2.1.1js-yaml->^4.1.0merge->^2.1.1degenerator->^5.0.1extend->^3.0.2form-data->^4.0.6debug->^4.4.0pac-resolver->^5.0.0protobufjs->^7.6.4node-forge->^1.4.0path-to-regexp->^0.1.13@grpc/grpc-js->^1.14.4jsonwebtoken->^9.0.3dicer->^0.3.1fast-xml-parser->^5.9.3C. Remaining CVEs
firebase(moderate SSRF protection bypass): used inunit-test-security-rules-v9. Upgrading would require migrating from v9 to v10.@google-cloud/firestore/@grpc/grpc-js: used infirebase-adminandfirebase. Downgraded transitives cannot be upgraded further without upgrading major library versions.@opentelemetry/core(moderate memory leak): used infirebase-tools.diff/minimatch/nanoid(moderate/high DoS): used inmocha.ip/pac-resolver(high SSRF): transitive dependency.D. Introduced CVEs
E. Testing Strategy
./scripts/test.sh).